using System.Windows;
using Common;
using Common.Enum;
using SExperiment;
using SExperiment.ExperimentResult;
using SWellPlate;

namespace MainView.MainControls.Chart
{
	public class ShiftCurveChart : BaseHRMCurveChart
	{
		public ShiftCurveChart()
		{
			base.Margin = new Thickness(1.0);
			base.HorizontalAlignment = HorizontalAlignment.Stretch;
			base.VerticalAlignment = VerticalAlignment.Stretch;
			SetResourceReference(BaseCurveChart.CaptionProperty, "temperature_shift_curve");
			SetResourceReference(BaseCurveChart.TitleXProperty, "Temperature");
			base.TitleY = "%";
			base.MinY = 0.0;
			base.MaxY = 1000.0;
			base.TitleXFormat = "0";
			base.TitleYFormat = "0.000";
		}

		public override string GetToolTipFormatX()
		{
			return "0.00";
		}

		public override Curve GetCurve(SampleTargetItem item)
		{
			if (item.Result is HRMTargetResult)
			{
				return ((HRMTargetResult)item.Result).ShiftCurve;
			}
			return null;
		}

		public override Curve GetCurve(ChartData chartData)
		{
			if (chartData.SampleTargetItem.SampleType == SampleType.Negative)
			{
				return null;
			}
			return base.GetCurve(chartData);
		}
	}
}
